package org.example.petitionplatformsystem.service.Impl;

import org.example.petitionplatformsystem.dao.SalesmanOperationLogRepository;
import org.example.petitionplatformsystem.dao.model.SalesmanOperationLog;
import org.example.petitionplatformsystem.service.SalesmanOperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalesmanOperationLogServiceImpl implements SalesmanOperationLogService {
    @Autowired
    SalesmanOperationLogRepository salesmanOperationLogRepository;

    @Override
    public void AddSalesmanOperationLog(SalesmanOperationLog salesmanOperationLog) {
        salesmanOperationLogRepository.save(salesmanOperationLog);
    }

    @Override
    public void DeleteSalesmanOperationLog(long id) {
         salesmanOperationLogRepository.deleteById(id);
    }

    @Override
    public void UpdateSalesmanOperationLog(SalesmanOperationLog salesmanOperationLog) {
        salesmanOperationLogRepository.save(salesmanOperationLog);
    }

    @Override
    public List<SalesmanOperationLog> GetAllSalesmanOperationLog() {
        return salesmanOperationLogRepository.findAll();
    }
}
